#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class JobLocation : BizObject
	 {
         #region Member Variables

         private Int32 _jobLocationID;

         private String _jobLocationName;

         private String _jobLocationName_en;

         private Int32 _countryID;

         private Int32 _displayOrder;

         #endregion



         #region Public Properties

         public Int32 JobLocationID
         {
             get { return _jobLocationID; }
             set { _jobLocationID = value; }
         }

         public String JobLocationName
         {
             get { return _jobLocationName; }
             set { _jobLocationName = value; }
         }

         public String JobLocationName_en
         {
             get { return _jobLocationName_en; }
             set { _jobLocationName_en = value; }
         }

         public Int32 CountryID
         {
             get { return _countryID; }
             set { _countryID = value; }
         }

         public Int32 DisplayOrder
         {
             get { return _displayOrder; }
             set { _displayOrder = value; }
         }

         #endregion


	    #region public static Methods
	     public static int Insert(JobLocation obj)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.Insert(obj);
	     }

	     public static bool Update(JobLocation obj)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.Update(obj);
	     }

	     public static bool Delete(Int32 JobLocationID)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.Delete(JobLocationID); 
	     }

	     public static JobLocation GetJobLocationByID(Int32 JobLocationID)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.GetJobLocationByID(JobLocationID);
	     }

         public static string GetJobLocationNameByID(Int32 JobLocationID)
         {
             try
             {
                 JobLocation obj = GetJobLocationByID(JobLocationID);
                 return (Globals.LangVietNam()) ? obj.JobLocationName : obj.JobLocationName_en;
             }
             catch { return ""; }
         }


         //Get All JobLocation
         public static List<JobLocation> GetAllJobLocation()
         {
             JobLocationDAL db = new JobLocationDAL();
             return db.GetAllJobLocation(1, MAXROWS);
         }

	     //Get All JobLocation
	     public static List<JobLocation> GetAllJobLocation(int PageIndex, int PageSize)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.GetAllJobLocation(PageIndex, PageSize);
	     }

	     // Get Count All records of Table  JobLocation
	     public static int GetCountJobLocation()
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.GetCountJobLocation();
	     }

         // Get JobLocationByCountryID
         public static List<JobLocation> GetJobLocationByCountryID(Int32 CountryID)
         {
             JobLocationDAL db = new JobLocationDAL();
             return db.GetJobLocationByCountryID(CountryID, 1, MAXROWS);
         }


	     // Get JobLocationByCountryID
	     public static List<JobLocation> GetJobLocationByCountryID(Int32 CountryID,int PageIndex, int PageSize)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.GetJobLocationByCountryID(CountryID, PageIndex, PageSize);
	     }

	     // Get JobLocationCountByCountryID
	     public static int GetJobLocationCountByCountryID(Int32 CountryID)
	     {
		     JobLocationDAL db = new JobLocationDAL();
		     return db.GetJobLocationCountByCountryID(CountryID);
	     }

	 #endregion
	 }
}
